/*
 * @Author: ray ray.chin@163.com
 * @Date: 2020-06-03 09:06:12
 * @LastEditors: ray ray.chin@163.com
 * @LastEditTime: 2022-12-30 14:19:29
 * @FilePath: /app-template-uni-upgrade/src/store/index.js
 * @Description: state初始化
 * Copyright (c) 2022 by ray ray.chin@163.com, All Rights Reserved.
 */

import Vue from 'vue'
import Vuex from 'vuex'
import { defaultState } from './state'
import mutations from './mutations'


import getters from './getters'
import actions from './actions'
// 将vuex的状态保存在localStorage中 其中可以有独立的配置
import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex);

export default new Vuex.Store({
    defaultState,
    mutations,
    getters,
    actions,
    plugins: [
        createPersistedState(),
        // createLogger()
    ]
});